export const http = (url,data={},method='get')=>{
	return new Promise((resolve,reject)=>{
		uni.showToast({
			title:'加载中...',
			icon:"error"
		})
		uni.request({
			method,
		    url:'http://apis.90000p.com/fkm/'+url, //仅为示例，并非真实接口地址。
		    data,
		    header: {
		        'Authorization': uni.getStorageSync('token') //自定义请求头信息
		    },
			timeout:2000,
		    success: (res) => {
		        
		        resolve(res.data)
		    },
			fail:(error) =>{
				
				reject(error)
			},
			
		});
	})
}
export  const get =(url,data={})=>{
	return http(url,data)
}
export const post =(url,data={})=>{
	return http(url,data,'post')
}